summaryrefslogtreecommitdiff
path: root/src/functionkeys.cpp
blob: 12c1098ea6a6d5e3ee8bb88bb92c2f1e9cbd4903 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "functionkeys.h"

#include "gamestate.h"

#include <bu/sio.h>
using namespace Bu;

FunctionKeys::FunctionKeys()
{
}

FunctionKeys::~FunctionKeys()
{
}

void FunctionKeys::call( class GameState &gState )
{
	Variable vDict = gState.popDeref();

	if( vDict.getType() != Variable::tDictionary )
		throw Bu::ExceptionBase("Parameter to keys must be a dictionary.");

	Variable vLst( Variable::tList );
	for( Variable::VariableHash::const_iterator i = vDict.getHash().begin();
		 i; i++ )
	{
		vLst += i.getKey();
	}

	gState.push( vLst );
}